﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Coolzon.UI.Charts.Widgets.Properties
{
    public class IndicatorsType : IEnumerable
    {
        private Dictionary<string, string> dicIndicatorsType = new Dictionary<string, string>();

        public string this[string seriesId]
        {
            get
            {
                if (dicIndicatorsType.Keys.Contains(seriesId))
                {
                    return dicIndicatorsType[seriesId];
                }
                else
                {
                    return "";
                }
            }
            set
            {
                dicIndicatorsType[seriesId] = value;
            }
        }

        public IEnumerator<KeyValuePair<string, string>> GetEnumerator()
        {
            foreach (var item in dicIndicatorsType)
            {
                yield return item;
            }
        }

        public bool ContainsKey(string seriesId)
        {
            if (dicIndicatorsType.Keys.Contains(seriesId))
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }
    }
}
